home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak Vol E-12
/
(Vol E-12) May 21 2012.iso
/
Animations
/
dj
/
dj.swf
/
scripts
/
__Packages
/
mx
/
events
/
LowLevelEvents.as
< prev
next >
Wrap
Text File
|
2012-05-21
|
7KB
|
247 lines
class mx.events.LowLevelEvents
{
static var mouseEvents = {mouseMove:1,mouseDown:1,mouseUp:1,mouseOver:1,mouseOut:1};
static var somewhereEvents = {mouseDownSomewhere:1,mouseUpSomewhere:1};
static var classConstructed = mx.events.LowLevelEvents.classConstruct();
static var UIEventDispatcherDependency = mx.events.UIEventDispatcher;
function LowLevelEvents()
{
}
static function addMouseEvents(obj)
{
if(obj.refcntMouseEvents > 0)
{
obj.refcntMouseEvents = obj.refcntMouseEvents + 1;
return undefined;
}
var _loc2_ = mx.events.UIEventDispatcher._fEventDispatcher;
obj.refcntMouseEvents = 1;
obj._onPress = obj.onPress;
obj.onPress = _loc2_.onPress;
obj._onRelease = obj.onRelease;
obj.onRelease = _loc2_.onRelease;
obj._onReleaseOutside = obj.onReleaseOutside;
obj.onReleaseOutside = _loc2_.onReleaseOutside;
obj._onRollOver = obj.onRollOver;
obj.onRollOver = _loc2_.onRollOver;
obj._onRollOut = obj.onRollOut;
obj.onRollOut = _loc2_.onRollOut;
obj._onDragOver = obj.onDragOver;
obj.onDragOver = _loc2_.onDragOver;
obj._onDragOut = obj.onDragOut;
obj.onDragOut = _loc2_.onDragOut;
}
static function removeMouseEvents(obj)
{
if(obj.refcntMouseEvents > 1)
{
obj.refcntMouseEvents = obj.refcntMouseEvents - 1;
return undefined;
}
obj.refcntMouseEvents = 0;
if(obj._onPress != undefined)
{
obj.onPress = obj._onPress;
}
else
{
delete obj.onPress;
}
if(obj._onRelease != undefined)
{
obj.onRelease = obj._onRelease;
}
else
{
delete obj.onRelease;
}
if(obj._onReleaseOutside != undefined)
{
obj.onReleaseOutside = obj._onReleaseOutside;
}
else
{
delete obj.onReleaseOutside;
}
if(obj._onRollOver != undefined)
{
obj.onRollOver = obj._onRollOver;
}
else
{
delete obj.onRollOver;
}
if(obj._onRollOut != undefined)
{
obj.onRollOut = obj._onRollOut;
}
else
{
delete obj.onRollOut;
}
if(obj._onDragOver != undefined)
{
obj.onDragOver = obj._onDragOver;
}
else
{
delete obj.onDragOver;
}
if(obj._onDragOut != undefined)
{
obj.onDragOut = obj._onDragOut;
}
else
{
delete obj.onDragOut;
}
if(obj._onMouseMove != undefined)
{
obj.onMouseMove = obj._onMouseMove;
}
else
{
delete obj.onMouseMove;
}
}
static function addSomewhereEvents(obj)
{
if(obj.refcntSomewhereEvents > 0)
{
obj.refcntSomewhereEvents = obj.refcntSomewhereEvents + 1;
return undefined;
}
var _loc2_ = mx.events.UIEventDispatcher._fEventDispatcher;
obj.refcntSomewhereEvents = 1;
obj._onMouseDown = obj.onMouseDown;
obj.onMouseDown = _loc2_.onMouseDown;
obj._onMouseUp = obj.onMouseUp;
obj.onMouseUp = _loc2_.onMouseUp;
}
static function removeSomewhereEvents(obj)
{
if(obj.refcntSomewhereEvents > 1)
{
obj.refcntSomewhereEvents = obj.refcntSomewhereEvents - 1;
return undefined;
}
obj.refcntSomewhereEvents = 0;
if(obj._onMouseDown != undefined)
{
obj.onMouseDown = obj._onMouseDown;
}
else
{
delete obj.onMouseDown;
}
if(obj._onMouseUp != undefined)
{
obj.onMouseUp = obj._onMouseUp;
}
else
{
delete obj.onMouseUp;
}
}
function onMouseMove(Void)
{
this.dispatchEvent({type:"mouseMove"});
this._onMouseMove();
}
function onRollOver(Void)
{
this.dispatchEvent({type:"mouseOver"});
if(this.__q_mouseMove.length > 0)
{
this._onMouseMove = this.onMouseMove;
var _loc2_ = mx.events.UIEventDispatcher._fEventDispatcher;
this.onMouseMove = _loc2_.onMouseMove;
}
this._onRollOver();
}
function onRollOut(Void)
{
this.dispatchEvent({type:"mouseOut"});
if(this.__q_mouseMove.length > 0)
{
if(this._onMouseMove != undefined)
{
this.onMouseMove == this._onMouseMove;
}
else
{
delete this.onMouseMove;
}
}
this._onRollOut();
}
function onPress(Void)
{
this.dispatchEvent({type:"mouseDown"});
this._onPress();
}
function onRelease(Void)
{
this.dispatchEvent({type:"mouseUp"});
this._onRelease();
}
function onReleaseOutside(Void)
{
this.dispatchEvent({type:"mouseUp"});
this._onReleaseOutside();
}
function onDragOver(Void)
{
this.dispatchEvent({type:"mouseOver"});
this._onDragOver();
}
function onDragOut(Void)
{
this.dispatchEvent({type:"mouseOut"});
this._onDragOut();
}
function onMouseDown(Void)
{
this.dispatchEvent({type:"mouseDownSomewhere"});
this._onMouseDown();
}
function onMouseUp(Void)
{
this.dispatchEvent({type:"mouseUpSomewhere"});
this._onMouseUp();
}
static function enableLowLevelEvents()
{
}
static function classConstruct()
{
var _loc1_ = mx.events.UIEventDispatcher;
var _loc4_ = mx.events.LowLevelEvents;
_loc1_.lowLevelEvents.mouseEvents = ["addMouseEvents","removeMouseEvents"];
_loc1_.lowLevelEvents.somewhereEvents = ["addSomewhereEvents","removeSomewhereEvents"];
_loc1_.mouseEvents = _loc4_.mouseEvents;
_loc1_.addMouseEvents = _loc4_.addMouseEvents;
_loc1_.removeMouseEvents = _loc4_.removeMouseEvents;
_loc1_.somewhereEvents = _loc4_.somewhereEvents;
_loc1_.addSomewhereEvents = _loc4_.addSomewhereEvents;
_loc1_.removeSomewhereEvents = _loc4_.removeSomewhereEvents;
if(_loc1_._fEventDispatcher == undefined)
{
_loc1_._fEventDispatcher = new mx.events.UIEventDispatcher();
}
var _loc3_ = _loc1_._fEventDispatcher;
var _loc2_ = _loc4_.prototype;
_loc3_.onPress = _loc2_.onPress;
_loc3_.onRelease = _loc2_.onRelease;
_loc3_.onReleaseOutside = _loc2_.onReleaseOutside;
_loc3_.onRollOut = _loc2_.onRollOut;
_loc3_.onRollOver = _loc2_.onRollOver;
_loc3_.onDragOut = _loc2_.onDragOut;
_loc3_.onDragOver = _loc2_.onDragOver;
_loc3_.onMouseDown = _loc2_.onMouseDown;
_loc3_.onMouseMove = _loc2_.onMouseMove;
_loc3_.onMouseUp = _loc2_.onMouseUp;
return true;
}
}